function throttle(fn, wait) {
    let last,timer;

    return function (args){
        let that  = this
        let _arg  = args
        let now = + new Date()

        if(last && now < last + wait){
            clearTimeout(timer)
            timer = setTimeout(()=>{
                last = now
                fn.apply(that, _arg)
            },wait)
        }else {
            last = now
            fn.apply(that,wait)
        }
    }
}
